package com.xyy.yueshijia.modle;

import com.xyy.yueshijia.api.RetrofitManager;
import com.xyy.yueshijia.bean.shop.StoreBean;
import java.util.Map;
import rx.Observable;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;


/**
 * Created by lxs on 2017/2/8.
 */

public class StroeModle {


    public void getShopData(Map<String,String> params , Subscriber<StoreBean> subscriber){

       RetrofitManager.getSingleton()
                .getIApiService()
                .getBeanStore(params)
                .subscribeOn(Schedulers.newThread())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(subscriber);

    }

    public void getShopStringData(Map<String,String> params , Subscriber<String> subscriber){

        Observable<String> observable = RetrofitManager.getSingleton()
                .getIApiStringService()
                .getStringStore(params);

        observable
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(subscriber);
    }
}
